<style type="text/css">
    .forward_details {
        border: double #333 3px;
        padding: 5px 15px;
        margin: 10px 0px;
    }

    .flyout_content td {
        padding: 5px;
    }

    .inline-bold {
        display: inline;
        font-weight: bold;
        border-bottom: dotted #999 1px;
    }

    .ordered_list {
        list-style-type: decimal;
        padding-left: 10px;
        margin: 5px;
        margin-left: 20px;
    }
    
    .flyout_content p {
        color: #111;
    }

    .flyout_content section, .flyout_content section td {
        margin-bottom: 10px;
        font-family:  Tahoma, Geneva, sans-serif;
        font-size: 13px;
    }

    .flyout_content section header {
        padding: 5px;
        margin-bottom: 10px;
        text-align: center;
    }

    .flyout_content section header h3 {
        text-transform: uppercase;
        font-weight: bold;
        font-size: 14px;
        font-family: "Trebuchet MS", Arial, Helvetica, sans-serif !important;
    }

    #pdf_wrapper, #pdf_wrapper td, #pdf_wrapper p {
        font-size: 11pt !important;
    }
    
    #print_wrapper, #print_wrapper td, #print_wrapper p {
        font-size: 13pt !important;
        line-height: 21px;
    }
</style>


<div class="forward_details">
    <table width="100%" border="0" cellspacing="0" cellpadding="5">
        <tr>
            <td width="20%">Tel No:</td>
            <td width="25%"><?php echo $permit['Permit']['company_tel']; ?></td>
            <td width="20%">Our File Ref:</td>
            <td width="25%"><?php echo $permit['Permit']['ref_no']; ?></td>
        </tr>
        <tr>
            <td valign="top">Company Sent To:</td>
            <td valign="top"><?php echo $permit['Permit']['company_name']; ?></td>
            <td valign="top">Purchase Order No.:</td>
            <td valign="top"><?php echo $permit['Permit']['company_po_no']; ?></td>
        </tr>
        <tr>
            <td>For The Attn:</td>
            <td><?php echo $permit['Permit']['company_contact']; ?></td>
            <td>Date:</td>
            <td><?php echo date('jS F, Y'); ?></td>
        </tr>
        <tr>
            <td>Originator:</td>
            <td colspan="2">S. B. MAN OPS CONTROL</td>
            <td>&nbsp;</td>
        </tr>
    </table>
</div>

<header>
    <h3><?php echo ucfirst($permit['Permit']['type']); ?> Permission</h3>
</header>  

<section>
    <p>As per C.A.A File Ref: <span class="inline-bold"><?php echo $permit['Permit']['permit_ref_no']; ?></span></p>

    <p>Ref. Your request for 
        <span class="inline-bold" style="text-transform: capitalize;">
            <?php echo $permit['Permit']['type']; // == "landing" ? "Tech. Landing" : "Overflight"; ?>
        </span> 

        <?php echo stristr($permit['Permit']['type'], "overflight") != false ? "Permission Over " : "Permission In "; ?>

        <span class="inline-bold">
            <?php echo $permit['Permit']['permit_location']; ?>
        </span> 
        dated 
        <span class="inline-bold">
            <?php echo date('jS M, Y', strtotime($permit['Permit']['application_dt'])); ?>
        </span>. 
    </p>

    <div style="padding: 10px;">
        <table width="90%" border="0" align="center" cellpadding="5" cellspacing="0">
            <tr>
                <td width="27%">Aircraft Type:</td>
                <td width="73%"><?php echo $permit['Permit']['aircraft_type']; ?></td>
            </tr>
            <tr>
                <td>Aircraft Registration:</td>
                <td><?php echo $permit['Permit']['aircraft_regn']; ?></td>
            </tr>
            <tr>
                <td>Flight Date:</td>
                <td><?php echo date('jS M, Y', strtotime($permit['PermitSchedule'][0]['arr_eta'])); ?></td>
            </tr>
            <tr>
                <td>Route:</td>
                <td><?php echo $permit['Permit']['flight_routes']; ?></td>
            </tr>
            <tr>
                <td colspan="2" style="height: 40px;" valign="bottom">
                    <b>Approval Has Been Granted To The Above Aircraft</b>
                </td>
            </tr>
            <tr>
                <td><?php echo strpos($permit['Permit']['type'], "overflight") === false ? "L/C" : "O/C"; ?> Permit No.: </td>
                <td><?php echo $permit['Permit']['permit_number']; ?></td>
            </tr>
            <tr>
                <td>Validity:</td>
                <td><?php echo $permit['Permit']['permit_validity']; ?></td>
            </tr>
        </table>
    </div>

</section>

<?php if (isset($staff)) { ?>
    <footer style="margin-top: 50px; margin-bottom: 20px;">
        <table width="100%" border="0" cellspacing="0" cellpadding="10">
            <tr>
                <td colspan="2">
                    MOST KIND RGDS - 
                </td>
            </tr>
            <tr>
                <td width="50%" style="text-transform: uppercase;"><?php echo $staff['User']['first_name'] . " " . $staff['User']['last_name']; ?></td>
            </tr>
            <tr>
                <td colspan="2" style="text-transform: uppercase;">
                    <?php echo $supervisor ? $supervisor['User']['first_name'] . ' ' . $supervisor['User']['last_name'] : "-----"; ?> / SUPERVISOR - OPS CONTROL
                </td>
            </tr>

            <tr>
                <td>
                    Ref.No:- <?php echo $permit['Permit']['ref_no']; ?>
                </td>
            </tr>
        </table>

        <div style="padding-top: 40px; font-size: 11px;">
            Caution Statement:- <br />
            a)Please notify us immediately there is the need to change aircraft mentioned in confirmation or change of route. <br />
            b)Please notify us if permit expires before its usage. Do not attempt to use an expired permit. <br />
            
            (HQ) P. O. Box OS 1734, Osu - Accra Ghana. 
            Tel: +233 24 4321 771(H24) Email:fltops@sbmangh.com 	 SITA/ARINC: ACCSM7X       AFTN: KACCGCKX   www.sbmangh.com <br /><br />


            <span style="text-transform: uppercase;">S.B.MAN & CO LTD - <?php echo $permit['Permit']['type']; ?> CLEARANCE FORWARDING FORM </span>

        </div>
    </footer>
<?php } ?>